package com.sg.controller.pbff;

import com.sg.service.biz.pbff.TypeCodeService;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "TypeCode", tags = {"TypeCode"})
@RestController
// @RequestMapping("/poms/typeCode/")
public class TypeCodeController {
    @Autowired
    TypeCodeService typeCodeService;

    /**
     * B1-1新增类型（平台）
     * gen by moon at 10/25/2022, 10:01:08 AM
     */
    @PostMapping("/oms/platform/typeCode/addType")
    @ApiOperation(value = "B1-1新增类型（平台）", response = OkrResult.class)
    public OkrResult<BffAddTypeRespDto> addType(@RequestBody(required = false) @Validated BffAddTypeReqDto reqDTO) {
        return OkrResult.success(typeCodeService.addType(reqDTO));
    }

    /**
     * B1查询存档条件编码列表（平台）
     * gen by moon at 8/10/2022, 3:44:18 AM
     */
    @PostMapping("/oms/platform/typeCode/queryArchiveCodeList")
    @ApiOperation(value = "B1查询存档条件编码列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryArchiveCodeListRespDto> queryArchiveCodeList(@RequestBody(required = false) @Validated BffQueryArchiveCodeListReqDto reqDTO) {
        return OkrResult.success(typeCodeService.queryArchiveCodeList(reqDTO));
    }

    /**
     * B1-1查询枚举对象属性下编码列表
     * gen by moon at 8/10/2022, 3:41:03 AM
     */
    @PostMapping("/oms/platform/typeCode/queryEnumerateCodeList")
    @ApiOperation(value = "B1-1查询枚举对象属性下编码列表", response = OkrResult.class)
    public OkrResult<BffQueryEnumerateCodeListRespDto> queryEnumerateCodeList(@RequestBody(required = false) @Validated BffQueryEnumerateCodeListReqDto reqDTO) {
        return OkrResult.success(typeCodeService.queryEnumerateCodeList(reqDTO));
    }

    /**
     * B1-1新增编码（平台）
     * gen by moon at 8/17/2022, 8:03:49 PM
     */
    @PostMapping("/oms/platform/typeCode/addCode")
    @ApiOperation(value = "B1-1新增编码（平台）", response = OkrResult.class)
    public OkrResult<BffAddCodeRespDto> addCode(@RequestBody(required = false) @Validated BffAddCodeReqDto reqDTO) {
        return OkrResult.success(typeCodeService.addCode(reqDTO));
    }

    /**
     * B1-1修改编码（平台）
     * gen by moon at 8/10/2022, 3:40:08 AM
     */
    @PostMapping("/oms/platform/typeCode/updateCode")
    @ApiOperation(value = "B1-1修改编码（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateCodeRespDto> updateCode(@RequestBody(required = false) @Validated BffUpdateCodeReqDto reqDTO) {
        return OkrResult.success(typeCodeService.updateCode(reqDTO));
    }

    /**
     * B1-1查询编码列表（平台）
     * gen by moon at 8/10/2022, 3:40:04 AM
     */
    @PostMapping("/oms/platform/typeCode/queryCodeList")
    @ApiOperation(value = "B1-1查询编码列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCodeListRespDto> queryCodeList(@RequestBody(required = false) @Validated BffQueryCodeListReqDto reqDTO) {
        return OkrResult.success(typeCodeService.queryCodeList(reqDTO));
    }

    /**
     * B1-1查询类型列表（平台）
     * gen by moon at 10/24/2022, 9:56:01 PM
     */
    @PostMapping("/oms/platform/typeCode/queryTypeList")
    @ApiOperation(value = "B1-1查询类型列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryTypeListRespDto> queryTypeList(@RequestBody(required = false) @Validated BffQueryTypeListReqDto reqDTO) {
        return OkrResult.success(typeCodeService.queryTypeList(reqDTO));
    }

    /**
     * B1-1查询类型详情（平台）
     * gen by moon at 8/10/2022, 3:39:20 AM
     */
    @PostMapping("/oms/platform/typeCode/queryTypeDetail")
    @ApiOperation(value = "B1-1查询类型详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryTypeDetailRespDto> queryTypeDetail(@RequestBody(required = false) @Validated BffQueryTypeDetailReqDto reqDTO) {
        return OkrResult.success(typeCodeService.queryTypeDetail(reqDTO));
    }

    /**
     * B1-1修改类型（平台）
     * gen by moon at 8/10/2022, 3:39:19 AM
     */
    @PostMapping("/oms/platform/typeCode/updateType")
    @ApiOperation(value = "B1-1修改类型（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateTypeRespDto> updateType(@RequestBody(required = false) @Validated BffUpdateTypeReqDto reqDTO) {
        return OkrResult.success(typeCodeService.updateType(reqDTO));
    }

    /**
     * B1-1查询类型列表（边界）
     * gen by moon at 8/10/2022, 3:42:53 AM
     */
    @PostMapping("/oms/platform/typeCode/queryTypeListBorder")
    @ApiOperation(value = "B1-1查询类型列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryTypeListBorderRespDto> queryTypeListBorder(@RequestBody(required = false) @Validated BffQueryTypeListBorderReqDto reqDTO) {
        return OkrResult.success(typeCodeService.queryTypeListBorder(reqDTO));
    }

}

